package com.weijianhuawen.wjblog.web.controller;

import com.weijianhuawen.wjblog.common.aspect.ApiOperationLog;
import com.weijianhuawen.wjblog.common.utils.PageResponse;
import com.weijianhuawen.wjblog.common.utils.Response;
import com.weijianhuawen.wjblog.web.mode.vo.tag.FindTagArticlePageListReqVo;
import com.weijianhuawen.wjblog.web.mode.vo.tag.FindTagListReqVo;
import com.weijianhuawen.wjblog.web.service.TagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @version: java version 8
 * @Author: weijianhuawen
 * @description:
 * @date: 2024-10-28 22:48
 */

@RestController
@RequestMapping("/tag")
@Api(tags = "标签模块")
public class TagController {
    @Autowired
    private TagService tagService;

    @PostMapping("/list")
    @ApiOperation(value = "获取标签列表")
    @ApiOperationLog(description = "获取标签列表")
    public Response findTagList(@RequestBody @Validated FindTagListReqVo vo) {
        return tagService.findTagList(vo);
    }

    @PostMapping("/article/list")
    @ApiOperation(value = "获取对应标签id关联的文章数据")
    @ApiOperationLog(description = "获取对应标签id的文章分页列表")
    public PageResponse findTagArticlePageList(@RequestBody @Validated FindTagArticlePageListReqVo vo) {
        return tagService.findTagArticlePageList(vo);
    }
}
